package com.eeepay.eeepay_v2.util;

import android.text.SpannableString;
import android.text.Spanned;
import android.text.style.ForegroundColorSpan;

import com.eeepay.eeepay_v2.app.MyApplication;

/**
 * Created by Ching on 2016/7/7.
 * 适配器中更改颜色工具类
 */
public class SpanUtils {

    public static SpannableString getSpan(String text, int color) {
        SpannableString ss = new SpannableString(text);
        ss.setSpan(new ForegroundColorSpan(MyApplication.context.getResources().getColor(color)),
                0, ss.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
        return ss;
    }
}
